<template>
  <div v-loading="loadChart" class="list-table" style="height: 700px;">
    <scatter-chart v-if="show" ref="scatterChart" :chart-data="chartData" height="100%" @clickHandel="clickHandel" />
    <div v-if="!show" class="noneData">
      <svg-icon icon-class="none" class-name="none-icon" />
      <p>{{ $t('暂无数据') }}</p>
    </div>
  </div>
</template>

<script>
import scatterChart from '@/views/chart/scatterChart'
import { countInvestment } from '@/api/base/deal/dealBase'
export default {
  components: {
    scatterChart
  },
  data() {
    return {
      chartData: [],
      show: true,
      emptyShow: false,
      loadChart: false
    }
  },
  created() {
  },
  mounted() {
    this.$nextTick(() => {
      this.getList()
    })
  },
  updated() {
  },
  methods: {
    getList() {
      this.loadChart = true
      countInvestment().then(response => {
        this.loadChart = false
        this.chartData = response.data
        this.show = this.chartData && this.chartData.length > 0
      })
    },
    clickHandel(ev) {
      // console.log(ev)
      const routeData = this.$router.resolve({ path: '/deal/home/dealBaseHome', query: { id: ev[3], companyId: ev[4] }})
      window.open(routeData.href, '_blank')
    }
  }
}
</script>

<style scoped>
</style>
